{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-10-10T07:49:30.053702Z",
     "start_time": "2025-10-10T07:49:30.050933Z"
    }
   },
   "source": [
    "import zmq\n",
    "\n",
    "def run():\n",
    "    context = zmq.Context()\n",
    "    socket = context.socket(zmq.SUB)\n",
    "    socket.connect(\"tcp://127.0.0.1:6666\")\n",
    "    socket.setsockopt_string(zmq.SUBSCRIBE, '')\n",
    "\n",
    "    print('client 1')\n",
    "    while True:\n",
    "        msg = socket.recv()\n",
    "        print(\"msg: %s\" % msg)\n",
    "\n",
    "    if __name__ == '__main__':\n",
    "        run()"
   ],
   "outputs": [],
   "execution_count": 8
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "14e30426f95c49dc"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
